from typing import List


class Solution:
    def search(self, nums: List[int], target: int) -> int:
        if (len(nums) == 0):
            return -1
        s, e = 0, len(nums)
        while e != s:
            mid = (e - s) // 2 + s
            if nums[mid] == target:
                return mid
            elif target < nums[mid]:
                e = mid
            else:
                s = mid + 1
        return -1

solu = Solution()
# print(solu.search(nums = [-1,0,3,5,9,12], target = 9))
# print(solu.search(nums = [-1,0,3,5,9,12], target = 13))
print(solu.search(nums=[2, 5], target=5))
